/**
 * @author 鍚存倍
 * @since 2022/10/13
 * 12:18
 */
package com.windgo.controller.admin;

import com.windgo.bean.MarketAddress;
import com.windgo.bean.common.BasePageInfo;
import com.windgo.bean.common.BaseRespVo;
import com.windgo.bean.common.CommonData;
import com.windgo.service.AddressService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/address")
public class AddressController {
    @Autowired
    AddressService addressService;
   /* @RequestMapping("list")
    public BaseRespVo list(BasePageInfo basePageInfo,Integer id){
        CommonData<MarketAddress> data = addressService.list(basePageInfo, id);
        return BaseRespVo.ok(data);
    }

    */
    @RequestMapping(value = "/list")
    @RequiresPermissions("perms[admin:address:list]")
    public BaseRespVo list(BasePageInfo basePageInfo,Integer userId,String name){
        CommonData<MarketAddress> data = addressService.search(basePageInfo, userId, name);
        return BaseRespVo.ok(data);
    }
}
